package com.hzw.saas.web.storage.param;

import javax.validation.constraints.NotBlank;

import com.hzw.saas.common.storage.enums.StorageModeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @author zzl
 * @since 07/04/2021
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel("合并资源文件参数")
public class ResourceFileMergeParam {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "文件ID", required = true)
    @NotBlank(message = "文件ID不可为空")
    private String fileId;

    @ApiModelProperty(value = "存储模式，1-服务器本地存储，2-S3云存储(默认)")
    private Integer storageMode;

    public void makeParamValid() {
        this.storageMode = StorageModeEnum.instanceValid(this.storageMode).code();
    }

}
